#ifndef EX7_4_PERSON
#define EX7_4_PERSON

#include <string>
#include <iostream>

class Person
{
    friend std::istream& read(std::istream& is, Person& person);
    friend std::ostream& print(std::ostream& os, const Person& person);

public:
    Person() = default;
    Person(const std::string& sname, const std::string& saddr) :name(sname), address(saddr) {}
    Person(std::istream& is) { read(is, *this); }

public:
    std::string get_name() const { return name; }
    std::string get_address() const { return address; }
    
private:
    std::string name;
    std::string address;
};

std::istream& read(std::istream& is, Person& person) {
    double price = 0;
    is >> person.name >> person.address;
    return is;
}

std::ostream& print(std::ostream& os, const Person& person) {
    os << person.get_name() << " " << person.get_address() << std::endl;
    return os;
}

#endif
